﻿<%@ Page Title="" Language="C#" EnableEventValidation="false" MasterPageFile="~/Portal/Master/Portal.Master" AutoEventWireup="true" CodeBehind="Comment.aspx.cs" Inherits="Besture.UI.Portal.UserCenter.Comment" %>

<%@ Import Namespace="Besture.Common.Helper" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="../../Resource/css/member.css" rel="stylesheet" />
    <script>
        //全选
        function selectAll(checkbox) {
            $('input[type=checkbox]').prop('checked', $(checkbox).prop('checked'));
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Content" runat="server">
    <div class="wrap">
        <div class="main member ">
            <div class="vipbanner"></div>

            <div class="container">
                <div class="layout_side">
                    <div class="side_nav">
                        <div class="headimg">
                            <img src="../../Resource/images/headimg.png" />
                            <div class="htitle"><%=LoginUserInfo.NickName==""?LoginUserInfo.NickName:LoginUserInfo.Phone %> 欢迎您！</div>
                            <abbr>金牌会员</abbr>
                        </div>
                        <cms:UserNav runat="server" ID="UserNav" />
                    </div>
                </div>
                <div class="layout_main">
                    <div class="vipcon">
                        <div class="viptitle">我的评价</div>
                        <div class="mailcon comment">
                            <table class="first">
                                <tr>
                                    <td width="150">                              
                                        <input type="checkbox"  onclick="selectAll(this);"  /><a href="javaScript:void(0)">全选
                                            <a href="javascipt:void(0);" class="del">删除</a>
                                            &nbsp;&nbsp;&nbsp; 酒店名称</a>
                                    </td>
                                    <td width="140">评价时间</td>
                                    <td width="320">评价内容</td>
                                    <td width="110">操作</td>
                                </tr>

                                <asp:Repeater ID="rpAppraisal" runat="server">
                                    <ItemTemplate>
                                        <tr>
                                            <td colspan="5">
                                                <table class="second">
                                                    <tr class="addstyle">
                                                        <td width="50">
                                                            <input type="checkbox" class="itme_all" tabindex="<%#Eval("ID") %>" />
                                                        </td>
                                                        <td width="130" class="pad">
                                                            <span class="themecolor"><%#Eval("HotelsName") %></span>
                                                        </td>
                                                        <td width="140"><%#Eval("AppraisalTime") %></td>
                                                        <td width="320" class="pad" style="text-align: left; color: #646464">
                                                            <p><%#Eval("Content") %></p>
                                                            <div class="reply">
                                                                <img src="../../Resource/images/trangle.png" />
                                                                <span class="themecolor">[回复]</span> <%# GetReviewsReplyByReviewsId(Convert.ToInt32(Eval("ID"))) %>
                                                            </div>
                                                        </td>
                                                        <td width="110">
                                                            <a href="?Id=<%#Eval("ID") %>" tabindex="<%#Eval("ID") %>" class="item_del">删除订单</a>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                </asp:Repeater>    
                                
                                <tr >
                                    <td colspan="5" style="text-align: right; padding-right: 20px;padding-top:10px">
                                         <!-- 分页 -->
                                        <cms:AspNetPager ID="AspNetPager1" AlwaysShow="true" runat="server" NextPageText="下一页" CssClass="pre"
                                            ShowFirstLast="False" ShowInputBox="Never" PrevPageText="上一页" PageSize="5" NumericButtonCount="5"
                                            OnPageChanging="AspNetPager1_PageChanging">
                                        </cms:AspNetPager>
                                        <!-- /分页 -->
                                    </td>
                                </tr>
                            </table>
                           
                        </div>
                        <br class="clear" />
                    </div>
                </div>
                <br class="clear" />
            </div>
        </div>
        <!-- //main -->
        <br class="clear" />
    </div>
    <!-- //wrap -->
    <script>
              
        $(function () {

            //多选择 删除
            $(".del").click(function () {
                var vDel = "";
                $(this).parents(".first").find("input:checked").each(function () {
                    vDel += $(this).attr("tabindex") + ",";
                });
                $.ajax({
                    type: "GET",
                    url: "/Portal/UserCenter/Comment.aspx",
                    data: {
                        delId: vDel.trim()
                    },
                    success: function (data) {
                        if (data.length > 0) {
                            alert("删除成功");
                            window.location.href = "/Portal/UserCenter/Comment.aspx";
                        } else {
                            alert("删除失败");
                        }
                    }
                });
            });

            // 单选 删除
            $(".item_del").click(function () {
                var vDelId = $(this).attr("tabindex");
                $.ajax({
                    type: "GET",
                    url: "/Portal/UserCenter/Comment.aspx",
                    data: {
                        delId: vDelId
                    },
                    success: function (data) {
                        if (data.length > 0) {
                            alert("删除成功");
                            window.location.href = "/Portal/UserCenter/Comment.aspx";
                        } else {
                            alert("删除失败");
                        }
                    }
                });
            });


            $(".personinfomation table tr").each(function () {
                $(this).children("td:not(:first)").css("padding-left", "35px");
            });
            $(".edit").each(function () {
                var _this = $(this);
                _this.click(function () {

                    _this.parent().prev().children("input").removeClass("none").addClass("show").removeAttr("readonly");
                    return false;
                });
            });

            //点击窗体其他位置关闭框
            $(window).click(function (e) {
                if (!$(e.target).is(".edit")) {
                    $(".edit").parent().prev().children("input").addClass("none");
                }
            });
            $(".date_input").date_input();
        })
    </script>
</asp:Content>
